_package("mvcdemo.model");

_class("HomeModel", ModelBase, function(){
	var requestUrl = "http://news.baidu.com/ns/";
	var params = {
				'ie' : 'utf-8',
				'word' : "",
				'tn' : 'newsrss',
				'sr' : '0',
				'cl' : '2',
				'rn' : '100',
				'ct' : '0',
				'timestamp' : ""
				};

	this._keyWords = "";

	this.setKeyWords = function(){
		var txt = $E("txtKey").value;
		this._keyWords = txt;
	};

	this.getList = function(fn){
		var params = this._makeParams();
		var _this = this;
		this._app.netInvoke("GET",requestUrl,params,'xml',this,fn);
	};

	this._makeParams = function(){
		params.word = this._keyWords;
		params.timestamp = (new Date()).getTime();
		return params;
	};
});

